<template>
	<view>
		<cu-custom bgColor="bg-blue" :isBack="true">
			<block slot="content">我的简历</block>
		</cu-custom>
		<view class="firpage" v-if="firpage">
			<view class="myResumme">
				<view class="TarBg" style="width: 100%;height: 180rpx;background-color: #3a73f4;"></view>
				<view class="person" style="height: 200rpx;background-color: #FFFFFF;margin: -100rpx 20rpx 0rpx 20rpx;border-radius: 15rpx;">
					<view class="myResumme_id" style="display: flex;padding: 20rpx 20rpx 0rpx 20rpx;">
						<view>
							<image :src="student_info.avatar" style="width: 90rpx;height: 90rpx;border-radius: 100%;margin-right: 20rpx ;"></image>
						</view>
						<view class="word">
							<view style="font-size: 30rpx;font-weight: bold;margin-bottom: 15rpx;">{{student_info.real_name||student_info.nickname}}</view>
							<view class="wordinfo">
								<!-- <text>{{student_info.school_name}}</text> -->
								<text>南昌职业大学</text>
								<!-- <text style="margin: 0rpx 10rpx 0rpx 10rpx;">|</text>
								<text>1年经验</text> 
								<text style="margin: 0rpx 10rpx 0rpx 10rpx;">|</text>
								<text>21岁</text> -->
							</view>
						</view>
						<view class="cuIcon-right" style="position: absolute; right: 45rpx; padding-top: 35rpx; color: #a2a4a3;"></view>
					</view>
					<view class="refresh" style="display: flex;">
						<view class="tion iconfont icon-shuaxin" @tap="again()">
							<text class="reWord">刷新简历</text>
						</view>
						<view class="tion iconfont icon-yulan">
							<text class="reWord">简历预览</text>
						</view>
					</view>
				</view>
			</view>
			<view class="contentinfo">
				<view class="infoSquare">
					<view class="squarelist" style="flex: 1;" @tap="showModal" data-target="Modal">
						<view>
							<text style="color: #000000;font-size: 30rpx;font-weight: bold;">【求职期望】</text>
							<text class="edit iconfont icon-bianji"></text>
						</view>
						<view class="textinfo" v-model="job_hope">
							{{job_hope}}
						</view>
					</view>
				</view>
				<!-- <view class="infoSquare">
					<view class="squarelist" style="flex: 1;">
						<text style="color: #000000;font-size: 30rpx;font-weight: bold;">【自我描述】</text>
						<text class="edit iconfont icon-bianji"></text>
					</view>
					<view class="WordInfo">
						<text style="font-size: 25rpx; color: #727272;">高级UI设计师，Adobe认证设计师，多年丰富项目产品UI设计工作经验，丰富移动端多行业服务设计经验，做事情有责任心，勇于担当。</text>
					</view>
				</view> -->
				<view class="infoSquare">
					<view class="squarelist" style="flex: 1;" @click="situationinfo()">
						<text style="color: #000000;font-size: 30rpx;font-weight: bold;">【学习经历】</text>
						<text class="edit iconfont icon-bianji"></text>
					</view>
					<view class="textinfo">
						{{situation}}
					</view>
				</view>
				<view class="infoSquare">
					<view class="squarelist" style="flex: 1;" @click="workexper()">
						<text style="color: #000000;font-size: 30rpx;font-weight: bold;">【工作经历】</text>
						<text class="edit iconfont icon-bianji"></text>
					</view>
					<view class="textinfo">
						{{skills}}
					</view>
				</view>
				
				
				<view style="bottom: 0; height: 30rpx;"></view>
			</view>
		</view>
		
		
		<view class="job_hopelist"v-show="job_hopelist" >			
			<view class="situationpage" >				
				<view style="padding: 30rpx;">
					<textarea maxlength="-1" @input="textareaAInput" placeholder="请输入你的期望~" v-model="job_hope"></textarea>
					<view class="modalbut flex">
						<button class="lin" style="width: 225rpx;height: 65rpx; line-height: 65rpx; border-radius: 50rpx; border:solid; border-color: #3b73f6 ; border-width: 1px;" @tap="hideModal">
							<text style="font-size: 30rpx; color: #3b73f6;">取消</text>
						</button>
						<button @tap="addPro" style="width: 225rpx;height: 65rpx; line-height: 65rpx;background-color: #3b73f6;border-radius: 50rpx;">
							<text style="color: #ffffff;font-size: 30rpx;">确定</text>
						</button>
					</view>
				</view>	
			</view>			
		</view>		
		<view class="situationlist" v-show="situationlist">
			<view class="situationpage">
				<view style="padding: 30rpx;">
					<textarea maxlength="-1" @input="textareaAInput" placeholder="请输入你的学习经历~" v-model="situation" ></textarea>
					<view class="modalbut flex">
						<button class="lin" style="width: 225rpx;height: 65rpx; line-height: 65rpx; border-radius: 50rpx; border:solid; border-color: #3b73f6 ; border-width: 1px;" @tap="hideModal">
							<text style="font-size: 30rpx; color: #3b73f6;">取消</text>
						</button>
						<button @tap="addPro" style="width: 225rpx;height: 65rpx; line-height: 65rpx;background-color: #3b73f6;border-radius: 50rpx;">
							<text style="color: #ffffff;font-size: 30rpx;">确定</text>
						</button>
					</view>
				</view>
			</view>
		</view>
		<view class="workexperlist" v-show="workexperlist">
			<view class="situationpage">
				<view style="padding: 30rpx;">
					<textarea maxlength="-1" @input="textareaAInput" placeholder="请输入你的工作经历~" v-model="skills"></textarea>
					<view class="modalbut flex">
						<button class="lin" style="width: 225rpx;height: 65rpx; line-height: 65rpx; border-radius: 50rpx; border:solid; border-color: #3b73f6 ; border-width: 1px;" @tap="hideModal">
							<text style="font-size: 30rpx; color: #3b73f6;">取消</text>
						</button>
						<button @tap="addPro" style="width: 225rpx;height: 65rpx; line-height: 65rpx;background-color: #3b73f6;border-radius: 50rpx;">
							<text style="color: #ffffff;font-size: 30rpx;">确定</text>
						</button>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const {appLogin,httpGet,httpPost,msg,timeToStr} = require("@/utils/common.js")
	export default {
		data() {
			return {
				modalName: '',
				textareaAValue: '',
				self:'',
				job_hope:'',
				situation:'',
				firpage:true,
				situationlist:false,
				workexperlist:'',
				job_hopelist:'',
				student_info:{},
				skills:'',
				student_id:0,
				real_name:'',
				student_id:'',
				
			}
		},
		onLoad(option) {
			appLogin((user_info) => {
				console.log(user_info)
				this.student_id = option.student_id
				console.log(this.student_id)
				this.getstuinfo()
			})
		},
		methods: {
			showModal() {
				this.job_hopelist = true;
			},
			hideModal(e) {
				this.modalName = null
				this.situationlist = false;
				this.workexperlist = false;
				this.job_hopelist = false;
				this.firpage = true;
			},
			textareaAInput(e) {
				this.textareaAValue = e.detail.value
			},
			addPro(){
				this.getresume()
				this.hideModal()
			},
			situationinfo(){
				this.situationlist = true;
				// this.firpage = false;
			},
			workexper(){
				this.workexperlist = true;
			},
			getstuinfo(){
				httpGet({
					url: '/api/student/info',
					data: {
						
						}
				}).then((res) => {
					this.student_info = res.result	
					this.job_hope = res.result.job_hope,
					this.situation = res.result.situation,
					this.skills = res.result.skills
					//console.log(res)
					
				})
			},
			getresume(){
				httpPost({
					url:'/api/student/set_field',
					data:{
						job_hope:this.job_hope,
						situation:this.situation,
						skills:this.skills

					}
				}).then((res)=>{								
					console.log(res)
				})
			},
			
			again(){
				this.getresume()
			}
		}
	}
</script>

<style>
	.wordinfo{
		font-size: 25rpx;
		color: #585858;
	}
	.tion{
		font-size: 35rpx;
		flex: 1;
		margin-left: 100rpx;
		margin-top: 20rpx;
		color: #666699;
	}
	.reWord{
		font-size: 25rpx;
		padding-left: 30rpx;
		color: #6e6e70;
	}
	.infoSquare{
		background-color: #FFFFFF;
		margin: 20rpx 20rpx 0rpx 20rpx;
		border-radius: 15rpx;
		padding: 15rpx 20rpx 10rpx 20rpx;
	}
	.edit{
		float: right;
		margin-top: 5rpx;
		color: #666699;
	}
	.firms{
		color: #797979;
		margin-right: 15rpx;
	}
	/* .WordInfo{
		margin: 20rpx 0rpx 10rpx 20rpx;
		word-wrap:break-word;
	} */
	.modalbut{
		margin-top: 30rpx;
	}
	.closen{
		text-align: right;
		margin: 20rpx 20rpx 10rpx 0rpx;
	}
	.textinfo{
		padding: 30rpx;
	}
	.situationlist{
		width: 100%;
		height: 100%;
		position: fixed;
		top: 0;
		/* left: 0; */
		z-index: 999;
		background-color: rgba(0, 0, 0, 0.5);
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}
	.situationpage{
		margin: 20rpx;
		background-color: white;
		border-radius: 30rpx;
	}
	.workexperlist{
		width: 100%;
		height: 100%;
		position: fixed;
		top: 0;
		/* left: 0; */
		z-index: 999;
		background-color: rgba(0, 0, 0, 0.5);
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}
	.job_hopelist{
		width: 100%;
		height: 100%;
		position: fixed;
		top: 0;
		/* left: 0; */
		z-index: 999;
		background-color: rgba(0, 0, 0, 0.5);
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}
	
</style>
